home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
ImportText.pdrx
< prev
next >
Wrap
Text File
|
1992-06-15
|
820b
|
43 lines
/*
@N
This Genie will import a text file into a rectangular region
*/
cr = '0a'x
filename = pdm_GetFileName("Select text file..", "", "")
if filename = "" then exit_msg()
if ~open(file, filename, r) then exit_msg("Unable to open "filename)
rect = pdm_ClickArea("Drag out area to flow text..")
parse var rect left ' ' top ' ' right ' ' bottom
call pdm_ShowStatus("Reading font list...")
fonts = pdm_InitText()
line = ''
call pdm_ShowStatus("Importing text...")
do while ~eof(file)
line = line || '0a'x || readln(file)
end
call close(file)
call pdm_ShowStatus("Rendering text...")
if line ~= '' then call pdm_FlowText(substr(line,2), left, top, right, bottom)
exit_msg("Done")
exit_msg: procedure
do
parse arg message
if message ~= '' then call pdm_Inform(1,message,)
call pdm_ClearStatus()
exit
end